Skip to content

Add a pure python wrapper fo pybindings.portable_lib #3218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

pytorchbot
Copy link
Collaborator

Summary:
When installed as a pip wheel, we must import torch before trying to import the pybindings shared library extension. This will load libtorch.so and related libs, ensuring that the pybindings lib can resolve those runtime dependencies.

So, add a pure python wrapper that lets us do this when users say import executorch.extension.pybindings.portable_lib

We only need this for OSS, so don't bother doing this for other pybindings targets.

Differential Revision: D56317150

Summary:
Pull Request resolved: #3137

When installed as a pip wheel, we must import `torch` before trying to import the pybindings shared library extension. This will load libtorch.so and related libs, ensuring that the pybindings lib can resolve those runtime dependencies.

So, add a pure python wrapper that lets us do this when users say `import executorch.extension.pybindings.portable_lib`

We only need this for OSS, so don't bother doing this for other pybindings targets.

Reviewed By: orionr, mikekgfb

Differential Revision: D56317150

fbshipit-source-id: 920382636732aa276c25a76163afb7d28b1846d0
(cherry picked from commit 969aa96)
Copy link

pytorch-bot bot commented Apr 22, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/3218

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 50a8b67 with merge base d3326a2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 22, 2024
@dbort dbort mentioned this pull request Apr 22, 2024
@guangy10 guangy10 merged commit 67d0dd7 into release/0.2 Apr 22, 2024
35 checks passed
@mergennachin mergennachin mentioned this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants